/**
 * 
 */
package abstractions;

/**
 * @author rdru
 * INV: pos reffers to the position at the beginig of the selection.
 */
public class Command {
	//int uid;		// actualy only needed when in the Compacted History
	//int docId;		// actualy only needed when in the Compacted History
	Pos pos;
	Part in, out;

	Command(Pos pos, Part out, Part in) {
		this.pos = pos;
		this.in = in;
		this.out = out;
	}

	Command reverse() {
		return new Command(pos, out, in);
	}		
	
	// create a new CommandC based on c by adding the current UserId and DocId
	CommandC CommandC(int uid, int docId) {
		return new CommandC(uid, docId, new PosC(pos), out, in);
	}
}
